package com.ylq.dao;

import com.ylq.pojo.User;
import com.ylq.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;


import java.util.List;

public class UserDaoText {

    public static void main(String[] args) {
            SqlSession sqlSession = MybatisUtils.getSqlSession();
            //方式一
            UserMapper mapper = sqlSession.getMapper(UserMapper.class);
            List<User> userList = mapper.getUserList();
            for (User user : userList) {
                System.out.println(user);
            }
            //关闭SqlSession
            sqlSession.close();

        }

    }